package Test;

import java.util.Scanner;

abstract class Employee{
	private String name;
	private int number;
	private MyDate birthday;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public MyDate getBirthday() {
		return birthday;
	}

	public void setBirthday(MyDate birthday) {
		this.birthday = birthday;
	}

	abstract double earnings();

	@Override
	public String toString() {
		return "Employee [name=" + name + ", number=" + number + ", birthday=" + birthday + "]";
	}

	public Employee(String name, int number, MyDate birthday) {
		super();
		this.name = name;
		this.number = number;
		this.birthday = birthday;
	}
	
}
 class MyDate{
	 private int year;
	 private int month;
	 private int day;

	public MyDate(int year, int month, int day) {
		super();
		this.year = year;
		this.month = month;
		this.day = day;
	}



	public int getYear() {
		return year;
	}



	public void setYear(int year) {
		this.year = year;
	}



	public int getMonth() {
		return month;
	}



	public void setMonth(int month) {
		this.month = month;
	}



	public int getDay() {
		return day;
	}



	public void setDay(int day) {
		this.day = day;
	}



	public String toDateString() {
		return "MyDate [year=" + year + ", month=" + month + ", day=" + day + "]";
	}
	 
 }

 class SalariedEmployee extends Employee{

	public SalariedEmployee(String name, int number, MyDate birthday, double monthlySalary) {
		super(name, number, birthday);
		this.monthlySalary = monthlySalary;
	}

	@Override
	double earnings() {
		// TODO Auto-generated method stub
		return monthlySalary;
	}

	@Override
	public String toString() {
	 return "正式工"+super.toString();
		
	}
    private double monthlySalary;
    
	public double getMonthlySalary() {
		return monthlySalary;
	}

	public void setMonthlySalary(double monthlySalary) {
		this.monthlySalary = monthlySalary;
	}


 }
 class HourlyEmployee extends Employee{
	 
	
	public HourlyEmployee(String name, int number, MyDate birthday, double wage, double hour) {
		super(name, number, birthday);
		this.wage = wage;
		this.hour = hour;
	}
	@Override
	double earnings() {
		// TODO Auto-generated method stub
		return wage*hour;
	}
	@Override
	public String toString() {
		return "正式工"+super.toString();
	}
	  private double wage;
     private double hour;
	public double getWage() {
		return wage;
	}
	public void setWage(double wage) {
		this.wage = wage;
	}
	public double getHour() {
		return hour;
	}
	public void setHour(double hour) {
		this.hour = hour;
	}
     
	 
 }
 
 
public class Test2 {
public static void main(String[] args) {

	Employee[] e=new Employee[2];
	e[0]=new SalariedEmployee("琪琪",10,new MyDate(2002,11,29),60);
	e[1]=new HourlyEmployee("梅梅",2,new MyDate(2002,3,18),40,6);
	Scanner input=new Scanner(System.in);
	int month=input .nextInt();
	for(int i=0;i<e.length;i++) {
		if(e[i].getBirthday().getMonth()==month) {
			System.out.println(e[i].toString()+e[i].earnings()+100);
		}
		else {
			System.out.println(e[i].toString()+e[i].earnings());
		}
	}
}
}
